package com.lion.ball.modules.orderfood.service.assistants.converters;

import java.sql.Timestamp;
import com.lion.common.base.utils.ConvertUtil;
import com.lion.common.base.utils.DbUtil;
import com.lion.common.spring.annotations.DataConverter;
import com.lion.common.spring.business.base.BaseConverter;
import com.lion.utils.TimeUtil;
import com.lion.ball.modules.orderfood.domain.entity.OfdTableOrderEntity;
import com.lion.ball.modules.orderfood.web.model.params.create.OfdTableOrderCreateParam;
import com.lion.ball.modules.orderfood.web.model.params.update.OfdTableOrderUpdateParam;
import com.lion.ball.modules.orderfood.web.model.results.OfdTableOrderResult;

/**
 * @author Chris Chan
 * Create on 2025-10-18 13:33
 * Use for: 桌位与订单关联 业务数据转换助手
 * Explain:
 * 
 */
@DataConverter
public class OfdTableOrderConverter implements BaseConverter<
        OfdTableOrderEntity,
        OfdTableOrderCreateParam,
        OfdTableOrderUpdateParam,
        OfdTableOrderResult> {
    @Override
    public OfdTableOrderEntity fromParam(OfdTableOrderCreateParam param) {
        OfdTableOrderEntity entity = new OfdTableOrderEntity();
        ConvertUtil.copyProperties(param, entity, "id");
        return entity;
    }

    @Override
    public OfdTableOrderEntity fromUpdateParam(OfdTableOrderUpdateParam param) {
        OfdTableOrderEntity entity = ConvertUtil.convert(param, OfdTableOrderEntity.class);
        return entity;
    }

    @Override
    public OfdTableOrderResult toResult(OfdTableOrderEntity entity) {
        OfdTableOrderResult result = ConvertUtil.convert(entity,OfdTableOrderResult.class);
        return result;
    }
}